package su.validator.param;

import javax.validation.constraints.NotEmpty;

import lombok.Data;
import su.validator.core.ValidateErrorHandler;
import su.validator.core.Verifiable;


@Data
public class UserValidateForm implements Verifiable {
    @NotEmpty
    private String name;

    @NotEmpty
    private String password;

    @Override
    public void validate(ValidateErrorHandler validateErrorHandler) {
        if (getName().equals(getPassword())){
            validateErrorHandler.handleError("user", "1", "用户名密码不能相同");
        }
    }
}
